package com.example.day2.busi.goods;

import androidx.lifecycle.MutableLiveData;

import com.example.day2.entity.GoodsResult;
import com.example.day2.entity.GoodsTableResult;
import com.example.day2.mvvm.base.BaseViewModel;

public class GoodsViewModel extends BaseViewModel<GoodsRepo> {
    protected MutableLiveData<GoodsResult> success = new MutableLiveData<>();
    protected MutableLiveData<String> fail = new MutableLiveData<>();
    public void getGoods(int type,int page,int size){
        repo.getGoodsList(type,page,size,success,fail);
    }


    protected MutableLiveData<GoodsTableResult> successType = new MutableLiveData<>();
    protected MutableLiveData<String> failType = new MutableLiveData<>();
    public void getGoodsType(){
        repo.getGoodsTable(successType,failType);
    }
    @Override
    public GoodsRepo createRepo() {
        return new GoodsRepo();
    }
}
